// @HashTable for FF FrameWork of Javascript 
// @author FangFeng
// @email:fangfeng335@qq.com
// @MSN:fangfeng335@hotmail.com
// @Vision:0.1
// @UpdateTime:2011-1-31
(function(){
		  if(!window.FF){window.FF={}};
		  
			function HashTable(){
			   // speacialKey For Leave Word in Javascript
			   var speacialKey = [
				"valueOf",
				"hasOwnProperty",
				"isPropertyOf",
				"propertyIsEnumerable",
				"prototype",
				"constructor",
				"toLocaleString",
				"toString" 
			   ];
			   var speacialvalue = new Array(speacialKey.length);
			   var speacialflag = new Array(speacialKey.length);
			   var normalHashtable = {};
			   
			   this.insert = function(key,value){
				for(var i =0;i<speacialKey.length;i++){
				 if(key == speacialKey[i]){
				  if(!speacialflag[i]){
				   speacialvalue[i] = value;
				   speacialflag[i] = true;
				   return true
				  }else{
				   return false;
				  }
				 }
				}
				normalHashtable[key] = value;
				return true;
			   }
			  
			   this.find = function(key){
				for(var i=0;i<speacialKey.length;i++){
				 if(key == speacialKey[i]){    
				  return speacialvalue[i];
				 }
				}
				return normalHashtable[key];
			   }
			}
			
		  window['FF']['HashTable']=HashTable;
})();
